package backpage.view;

import java.util.ArrayList;
import java.util.List;

public class PageDivision {	//the class to store the set of resource items to display
	private int curPage;
	private int totalPageNum;
	private ArrayList itemList;


	public PageDivision(int curPage, int totalPageNum, ArrayList itemList){
		this.curPage = curPage;
		this.totalPageNum = totalPageNum;
		this.itemList = itemList;
	}
	
	public boolean hasPreviousPage(){//whether the previous page exists
		return (curPage-1) > 0;
	}
	
	public boolean hasNextPage(){//whether the next page exists
		return (totalPageNum-curPage) > 0;
	}
	
	public int getCurPage(){
		return curPage;
	}
	
	public void setCurPage(int curPage){
		this.curPage = curPage;
	}
	
	public int getTotalPageNum(){
		return totalPageNum;
	}
	
	public void setTotalPageNum(int totalPageNum){
		this.totalPageNum = totalPageNum;
	}
	
	public ArrayList getitemList(){
		return itemList;
	}
	
	public void setitemList(ArrayList list){
		this.itemList = list;
	}

}
